home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / shwdlg16.hqx / ShowDialog XCMD 1.6 / card_3773.txt < prev    next >
Text File  |  1989-05-10  |  5KB  |  124 lines

  1. -- card: 3773 from stack: in.6
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3411
  5. -- name: Type 3 XCMD
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 80
  10. -- high flags: A003
  11. -- rect: left=229 top=149 right=171 bottom=478
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: "Change" Dialog with Radio Buttons
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   ShowDialog 3,4743,"Find What:","Change To:", "Your string goes here.",8
  23.   if the result is empty then
  24.     put return & "You clicked the ΓÇ£CancelΓÇ¥ button." into bg fld "theResult"
  25.   else
  26.     put the result into temp
  27.     if line 1 of temp = 7 then
  28.       put "Button hilited was: Starts With" & return into bg fld "theResult"
  29.     else if line 1 of temp = 8 then
  30.       put "Button hilited was: Contains" & return into bg fld "theResult"
  31.     else if line 1 of temp = 9 then
  32.       put "Button hilited was: Whole Word" & return into bg fld "theResult"
  33.     end if
  34.     if line 2 of temp is empty then
  35.       put "String 1 was:  empty" & return after bg fld "theResult"
  36.     else put "String 1 was:" && line 2 of temp & return after bg fld "theResult"
  37.     if line 3 of temp is empty then
  38.       put "String 2 was:  empty" after bg fld "theResult"
  39.     else put "String 2 was:" && line 3 of temp after bg fld "theResult"
  40.   end if
  41. end mouseUp
  42.  
  43.  
  44.  
  45. -- part 2 (button)
  46. -- low flags: 80
  47. -- high flags: 0000
  48. -- rect: left=11 top=4 right=64 bottom=78
  49. -- title width / last selected line: 0
  50. -- icon id / first selected line: 529 / 529
  51. -- text alignment: 1
  52. -- font id: 0
  53. -- text size: 12
  54. -- style flags: 0
  55. -- line height: 16
  56. -- part name: 
  57.  
  58.  
  59. -- part 3 (button)
  60. -- low flags: 00
  61. -- high flags: 0000
  62. -- rect: left=11 top=4 right=64 bottom=78
  63. -- title width / last selected line: 0
  64. -- icon id / first selected line: 529 / 529
  65. -- text alignment: 1
  66. -- font id: 0
  67. -- text size: 12
  68. -- style flags: 0
  69. -- line height: 16
  70. -- part name: SD
  71.  
  72.  
  73. -- part contents for background part 21
  74. ----- text -----
  75. ShowDialog XCMD Type 3
  76.  
  77. -- part contents for background part 30
  78. ----- text -----
  79. 15
  80.  
  81. -- part contents for background part 18
  82. ----- text -----
  83. ShowDialog XCMD Type 3 displays an "ask" dialog that can contain as many radio buttons and Editable Text fields as you desire.  All the radio buttons must belong to a single "group."
  84.  
  85. You pass in the parameter list which one of the radio buttons is to be initially hilited.  
  86.  
  87. The item # of the radio button that is hilited when the OK button is clicked is returned in "the result," along with the text of the editable text fields in a return-delimited list.
  88.  
  89.            •••••••••••••••••
  90. If you've been using versions of ShowDialog older than 1.6, please note that the result for Type 3 is now RETURN-delimited, instead of comma-delimited.  ShowDialog Type 3 can also now have as many Editable Text fields as you desire.
  91.            •••••••••••••••••
  92.  
  93.  
  94.  
  95. -- part contents for background part 15
  96. ----- text -----
  97. ShowDialog Type 3 parameters are:
  98.  
  99. ShowDialog 3,<DLOG resource ID>,<first prompt string>,<second prompt string>,<default entry string>,<item # of radio button to hilite>[,<top coord>,<left coord>]
  100.  
  101. where 3 is the type of the external;
  102. <DLOG resource ID> is the resource ID of the DLOG template;
  103. <first prompt string> consists of the dialog's first text string;
  104. <second prompt string> consists of the dialog's second text string (if you want one);
  105. <default entry string> is a default text string to appear in a text entry field;
  106. <item # of radio button to hilite> is the DITL item # of the radio button that will be hilited when the dialog is initially displayed.
  107.  
  108. Once again, the last two parameters, for specifying the location of the dialog, are OPTIONAL.
  109.  
  110.  
  111.  
  112. -- part contents for background part 17
  113. ----- text -----
  114. Creating the resources for ShowDialog XCMD Type 3:
  115.  
  116. The method for constructing DLOG/DITL templates for Type 3 of ShowDialog is similar as for Type 2.  The only difference is that this type cannot contain a checkbox.  Instead, put as many radio buttons as you want on the template.  They will all be automatically grouped by ShowDialog XCMD into a single unit, making sure that only a single button can be hilited at a time.
  117.  
  118. As you construct your template, make note of the item # of the radio button that you would like to be hilited when the dialog is initially displayed.  You will pass this item number in the parameter list.
  119.  
  120. The result consists of a return-delimited list.  Line 1 of the result will contain the item # of the radio button that was hilited when OK was clicked.  The remaining lines of the result will contain the contents of your Editable Text fields.
  121.  
  122. If the user clicks the Cancel button "the result" will be empty.
  123.  
  124.